package com.example.document

import android.text.BoringLayout
import android.view.View
import android.view.ViewGroup
import com.example.document.entity.Data
import com.example.document.entity.DocEntity
import com.example.lib_adapter.BaseQuickAdapter
import com.example.lib_adapter.BaseViewHolder
import java.text.SimpleDateFormat
import java.util.Date

class DocAdapter(layout: Int):BaseQuickAdapter<Data,BaseViewHolder>(layout) {
    init {
        addItemChildClick(R.id.doc_delete,R.id.doc_iv)

    }
    override fun convert(holder: BaseViewHolder, t: Data) {
        holder.apply {
            setText(R.id.doc_name,t.fileName)
            val sdf = SimpleDateFormat("yyyy-MM-dd hh:MM:ss")
            val time = sdf.format(Date(t.fileTime))
            setText(R.id.doc_time,time)
            setImage(R.id.doc_iv,t.filePath)
        }
    }
}